﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace OneMG.Phoenix.Kernel.Util
{

    public static class JsonResult
    {
        public static void Result(HttpContext context, JsonMessageStatus status, string msg)
        {

            Result(context, status, msg, null);
        }

        public static void Result(HttpContext context, JsonMessageStatus status, string msg, string response)
        {
            context.Response.ContentType = "application/json";
            context.Response.Write("{\"response\":null,\"status\":\"" + status.ToString().ToLower() + "\",\"msg\":\"" + msg + "\"}");

        }

    }
    public enum JsonMessageStatus
    {
        None = 0,
        Error = 16,
        Question = 32,
        Warning = 48,
        Information = 64,
        OK = 128,
    }
}
